import { reactive, ref } from 'vue'
import { TASK_TYPE, TASK_QUESTION_TYPE } from '@/utils/dictionary'

const startList = [
  { type: 'input', key: 'longitude', label: '经纬度', props: { placeholder: '起点经度' }},
  { type: 'input', key: 'latitude', label: '', props: { placeholder: '起点纬度' }}
]

export const form = reactive({
  userForm: {
    questionName: null,
    longitude: null,
    latitude: null,
    fileImage: '',
    imgList: null,
    handlerResult: '',
    handlerTime: '',
    handlerUsername: ''
  },
  userRules: {},
  formItem: [
    { type: 'select', key: 'questionName', label: '问题类型', props: { options: TASK_QUESTION_TYPE, placeholder: '请选择问题类型', clearable: true }},
    { type: 'inputGroup', key: 'startVal', label: '经纬度', values: startList },
    { type: 'oss', key: 'fileImage', label: '问题图片' },
    { type: 'oss', key: 'imgList', label: '处理图片' },
    { type: 'input', key: 'handlerResult', label: '处理意见', props: { placeholder: '', clearable: true }},
    { type: 'input', key: 'handlerTime', label: '处理时间', props: { placeholder: '', clearable: true }},
    { type: 'input', key: 'handlerUsername', label: '处理人员', props: { placeholder: '', clearable: true }}
  ],
  // 图片位置
  userForm2: {
    questionCode: null,
    longitude: null,
    latitude: null,
    fileImage: ''
  },
  userRules2: {},
  formItem2: [
    { type: 'select', key: 'questionCode', label: '问题类型', props: { options: TASK_QUESTION_TYPE, placeholder: '请选择问题类型', clearable: true }},
    { type: 'inputGroup', key: 'startVal', label: '经纬度', values: startList },
    { type: 'oss', key: 'fileImage', label: '图片' }
  ]
})
